/**
 * SpellConf
 * Configuration for object Spell
 **/
var SpellConf = {
	// String
	name : 'Name of spell',
	// Numbers
	damage : {
		min : 1,
		max : 20
	},
	cooldown : {
		min : 0,
		max : 25
	},
	distance : {
		min : 100,
		max : 400
	},
	size : {
		min : 10,
		max : 30
	},
	multi : {
		min : 1,
		max : 3
	},
	// Combos box
	element : {
		list : ['fire', 'ice']
	},
	effect	 	: {
		list : ['none', 'stun', 'pushBack', 'poison', 'heal']
	},
	// Preview icon
	icon : 0,
	// Defines template
	string : function(name, list, selected) {
		var out = '<select name="'+name+'">';
		for (var iL = 0, cL = list.length; iL < cL; iL++) {
			var select = '';
			if(selected == list[iL]) {
				select = 'selected="selected"';
			}
			out += '<option '+select+'>'+list[iL]+'</option>';
		}
		out += '</select>';

		return out;
	},

	// Spell preview icons
	previewIcons : [
		'0.png',
		'1.png',
		'2.png',
		'3.png',
		'4.png',
		'5.png',
		'6.png',
		'7.png'
	],

	// Get default spell if there is no one
	getDefault : function() {
		var FireBall = new Spell();
		FireBall.summon = function() {
			// CARACTERISTICS
			this.name 	 	= 'FireBall';	//Name
			this.target		= {x:0,y:0}; 	//Where spell goes
			this.bounds		= {w:0,h:0}; 	//Hit box
			this.damage		= 15;			//Damage inflicted to target
			this.cooldown 	= 2;			//Waiting time between 2 spells
			this.distance 	= 200; 			//Distance from player spell can be created
			this.multi 		= 0;			//Number of target can be hit
			this.effect	 	= 'none';		//Type of effect on target (none / stun / pushBack / poison / heal)
			this.duration 	= 0;			//Duration of effect on target
			this.icon 		= 0;			//Preview icon
		}

		FireBall.summon();

		return FireBall;
	}
}